/*
 * Amazon Ads API - Sponsored Products
 * Use the Amazon Ads API for Sponsored Products for campaign, ad group, keyword, negative keyword, and product ad management operations. For more information about Sponsored Products, see the [Sponsored Products Support Center](https://advertising.amazon.com/help?entityId=ENTITY3CWETCZD9HEG2#GWGFKPEWVWG2CLUJ). For onboarding information, see the [account setup](setting-up/account-setup) topic.<br/><br/> 
 *
 * The version of the OpenAPI document: 2.0
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package org.openapitools.client.model;

import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.openapitools.client.model.Bidding;
import org.openapitools.client.model.State;

/**
 * Campaign
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-04-12T19:05:39.971406+08:00[Asia/Shanghai]")
public class Campaign {
  public static final String SERIALIZED_NAME_PORTFOLIO_ID = "portfolioId";
  @SerializedName(SERIALIZED_NAME_PORTFOLIO_ID)
  private BigDecimal portfolioId;

  public static final String SERIALIZED_NAME_CAMPAIGN_ID = "campaignId";
  @SerializedName(SERIALIZED_NAME_CAMPAIGN_ID)
  private BigDecimal campaignId;

  public static final String SERIALIZED_NAME_NAME = "name";
  @SerializedName(SERIALIZED_NAME_NAME)
  private String name;

  public static final String SERIALIZED_NAME_TAGS = "tags";
  @SerializedName(SERIALIZED_NAME_TAGS)
  private Map<String, String> tags = null;

  /**
   * The advertising product managed by this campaign.
   */
  @JsonAdapter(CampaignTypeEnum.Adapter.class)
  public enum CampaignTypeEnum {
    SPONSOREDPRODUCTS("sponsoredProducts");

    private String value;

    CampaignTypeEnum(String value) {
      this.value = value;
    }

    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    public static CampaignTypeEnum fromValue(String value) {
      for (CampaignTypeEnum b : CampaignTypeEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

    public static class Adapter extends TypeAdapter<CampaignTypeEnum> {
      @Override
      public void write(final JsonWriter jsonWriter, final CampaignTypeEnum enumeration) throws IOException {
        jsonWriter.value(enumeration.getValue());
      }

      @Override
      public CampaignTypeEnum read(final JsonReader jsonReader) throws IOException {
        String value =  jsonReader.nextString();
        return CampaignTypeEnum.fromValue(value);
      }
    }
  }

  public static final String SERIALIZED_NAME_CAMPAIGN_TYPE = "campaignType";
  @SerializedName(SERIALIZED_NAME_CAMPAIGN_TYPE)
  private CampaignTypeEnum campaignType;

  /**
   * The type of targeting of the campaign.
   */
  @JsonAdapter(TargetingTypeEnum.Adapter.class)
  public enum TargetingTypeEnum {
    MANUAL("manual"),
    
    AUTO("auto");

    private String value;

    TargetingTypeEnum(String value) {
      this.value = value;
    }

    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    public static TargetingTypeEnum fromValue(String value) {
      for (TargetingTypeEnum b : TargetingTypeEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

    public static class Adapter extends TypeAdapter<TargetingTypeEnum> {
      @Override
      public void write(final JsonWriter jsonWriter, final TargetingTypeEnum enumeration) throws IOException {
        jsonWriter.value(enumeration.getValue());
      }

      @Override
      public TargetingTypeEnum read(final JsonReader jsonReader) throws IOException {
        String value =  jsonReader.nextString();
        return TargetingTypeEnum.fromValue(value);
      }
    }
  }

  public static final String SERIALIZED_NAME_TARGETING_TYPE = "targetingType";
  @SerializedName(SERIALIZED_NAME_TARGETING_TYPE)
  private TargetingTypeEnum targetingType;

  public static final String SERIALIZED_NAME_STATE = "state";
  @SerializedName(SERIALIZED_NAME_STATE)
  private State state;

  public static final String SERIALIZED_NAME_DAILY_BUDGET = "dailyBudget";
  @SerializedName(SERIALIZED_NAME_DAILY_BUDGET)
  private Float dailyBudget;

  public static final String SERIALIZED_NAME_START_DATE = "startDate";
  @SerializedName(SERIALIZED_NAME_START_DATE)
  private String startDate;

  public static final String SERIALIZED_NAME_END_DATE = "endDate";
  @SerializedName(SERIALIZED_NAME_END_DATE)
  private String endDate;

  public static final String SERIALIZED_NAME_PREMIUM_BID_ADJUSTMENT = "premiumBidAdjustment";
  @SerializedName(SERIALIZED_NAME_PREMIUM_BID_ADJUSTMENT)
  private Boolean premiumBidAdjustment;

  public static final String SERIALIZED_NAME_BIDDING = "bidding";
  @SerializedName(SERIALIZED_NAME_BIDDING)
  private Bidding bidding;


  public Campaign portfolioId(BigDecimal portfolioId) {
    
    this.portfolioId = portfolioId;
    return this;
  }

   /**
   * The identifier of an existing portfolio to which the campaign is associated.
   * @return portfolioId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The identifier of an existing portfolio to which the campaign is associated.")

  public BigDecimal getPortfolioId() {
    return portfolioId;
  }


  public void setPortfolioId(BigDecimal portfolioId) {
    this.portfolioId = portfolioId;
  }


  public Campaign campaignId(BigDecimal campaignId) {
    
    this.campaignId = campaignId;
    return this;
  }

   /**
   * The identifier of the campaign.
   * @return campaignId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The identifier of the campaign.")

  public BigDecimal getCampaignId() {
    return campaignId;
  }


  public void setCampaignId(BigDecimal campaignId) {
    this.campaignId = campaignId;
  }


  public Campaign name(String name) {
    
    this.name = name;
    return this;
  }

   /**
   * The name of the campaign.
   * @return name
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The name of the campaign.")

  public String getName() {
    return name;
  }


  public void setName(String name) {
    this.name = name;
  }


  public Campaign tags(Map<String, String> tags) {
    
    this.tags = tags;
    return this;
  }

  public Campaign putTagsItem(String key, String tagsItem) {
    if (this.tags == null) {
      this.tags = new HashMap<String, String>();
    }
    this.tags.put(key, tagsItem);
    return this;
  }

   /**
   * A list of advertiser-specified custom identifiers for the campaign. Each customer identifier is a key-value pair. You can specify a maximum of 50 identifiers.
   * @return tags
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "{\"PONumber\":\"examplePONumber\",\"accountManager\":\"exampleAccountManager\"}", value = "A list of advertiser-specified custom identifiers for the campaign. Each customer identifier is a key-value pair. You can specify a maximum of 50 identifiers.")

  public Map<String, String> getTags() {
    return tags;
  }


  public void setTags(Map<String, String> tags) {
    this.tags = tags;
  }


  public Campaign campaignType(CampaignTypeEnum campaignType) {
    
    this.campaignType = campaignType;
    return this;
  }

   /**
   * The advertising product managed by this campaign.
   * @return campaignType
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The advertising product managed by this campaign.")

  public CampaignTypeEnum getCampaignType() {
    return campaignType;
  }


  public void setCampaignType(CampaignTypeEnum campaignType) {
    this.campaignType = campaignType;
  }


  public Campaign targetingType(TargetingTypeEnum targetingType) {
    
    this.targetingType = targetingType;
    return this;
  }

   /**
   * The type of targeting of the campaign.
   * @return targetingType
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The type of targeting of the campaign.")

  public TargetingTypeEnum getTargetingType() {
    return targetingType;
  }


  public void setTargetingType(TargetingTypeEnum targetingType) {
    this.targetingType = targetingType;
  }


  public Campaign state(State state) {
    
    this.state = state;
    return this;
  }

   /**
   * Get state
   * @return state
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public State getState() {
    return state;
  }


  public void setState(State state) {
    this.state = state;
  }


  public Campaign dailyBudget(Float dailyBudget) {
    
    this.dailyBudget = dailyBudget;
    return this;
  }

   /**
   * The daily budget of the campaign.
   * minimum: 1.0
   * @return dailyBudget
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The daily budget of the campaign.")

  public Float getDailyBudget() {
    return dailyBudget;
  }


  public void setDailyBudget(Float dailyBudget) {
    this.dailyBudget = dailyBudget;
  }


  public Campaign startDate(String startDate) {
    
    this.startDate = startDate;
    return this;
  }

   /**
   * The starting date of the campaign. The format of the date is YYYYMMDD.
   * @return startDate
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The starting date of the campaign. The format of the date is YYYYMMDD.")

  public String getStartDate() {
    return startDate;
  }


  public void setStartDate(String startDate) {
    this.startDate = startDate;
  }


  public Campaign endDate(String endDate) {
    
    this.endDate = endDate;
    return this;
  }

   /**
   * The ending date of the campaign to stop running. The format of the date is YYYYMMDD.
   * @return endDate
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The ending date of the campaign to stop running. The format of the date is YYYYMMDD.")

  public String getEndDate() {
    return endDate;
  }


  public void setEndDate(String endDate) {
    this.endDate = endDate;
  }


  public Campaign premiumBidAdjustment(Boolean premiumBidAdjustment) {
    
    this.premiumBidAdjustment = premiumBidAdjustment;
    return this;
  }

   /**
   * If set to true, Amazon increases the default bid for ads that are eligible to appear in this placement. See developer notes for more information.
   * @return premiumBidAdjustment
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "If set to true, Amazon increases the default bid for ads that are eligible to appear in this placement. See developer notes for more information.")

  public Boolean getPremiumBidAdjustment() {
    return premiumBidAdjustment;
  }


  public void setPremiumBidAdjustment(Boolean premiumBidAdjustment) {
    this.premiumBidAdjustment = premiumBidAdjustment;
  }


  public Campaign bidding(Bidding bidding) {
    
    this.bidding = bidding;
    return this;
  }

   /**
   * Get bidding
   * @return bidding
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public Bidding getBidding() {
    return bidding;
  }


  public void setBidding(Bidding bidding) {
    this.bidding = bidding;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    Campaign campaign = (Campaign) o;
    return Objects.equals(this.portfolioId, campaign.portfolioId) &&
        Objects.equals(this.campaignId, campaign.campaignId) &&
        Objects.equals(this.name, campaign.name) &&
        Objects.equals(this.tags, campaign.tags) &&
        Objects.equals(this.campaignType, campaign.campaignType) &&
        Objects.equals(this.targetingType, campaign.targetingType) &&
        Objects.equals(this.state, campaign.state) &&
        Objects.equals(this.dailyBudget, campaign.dailyBudget) &&
        Objects.equals(this.startDate, campaign.startDate) &&
        Objects.equals(this.endDate, campaign.endDate) &&
        Objects.equals(this.premiumBidAdjustment, campaign.premiumBidAdjustment) &&
        Objects.equals(this.bidding, campaign.bidding);
  }

  @Override
  public int hashCode() {
    return Objects.hash(portfolioId, campaignId, name, tags, campaignType, targetingType, state, dailyBudget, startDate, endDate, premiumBidAdjustment, bidding);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class Campaign {\n");
    sb.append("    portfolioId: ").append(toIndentedString(portfolioId)).append("\n");
    sb.append("    campaignId: ").append(toIndentedString(campaignId)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    tags: ").append(toIndentedString(tags)).append("\n");
    sb.append("    campaignType: ").append(toIndentedString(campaignType)).append("\n");
    sb.append("    targetingType: ").append(toIndentedString(targetingType)).append("\n");
    sb.append("    state: ").append(toIndentedString(state)).append("\n");
    sb.append("    dailyBudget: ").append(toIndentedString(dailyBudget)).append("\n");
    sb.append("    startDate: ").append(toIndentedString(startDate)).append("\n");
    sb.append("    endDate: ").append(toIndentedString(endDate)).append("\n");
    sb.append("    premiumBidAdjustment: ").append(toIndentedString(premiumBidAdjustment)).append("\n");
    sb.append("    bidding: ").append(toIndentedString(bidding)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}

